<?php

class Core_Hook_Layout{

    /**
     * init page start
     */
    static public function onPageStart() {
        
        $setting = Nuo::getApi('Setting');
        
        $view = Zend_Registry::get('Zend_View');
        
        // static base  url
        $staticUrl = $view -> baseUrl();
        
        // static base url
        $view -> headScript() -> prependFile($staticUrl . '/static/scripts/jquery/latest.js');
        
        // some thing else
        $view->headMeta()
	      ->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
	      ->appendHttpEquiv('Content-Language', $view->locale()->getLocale()->__toString());


        // append site title
        $view -> headTitle($setting->getSetting('core.site.title'));

        $view -> headLink() -> prependStylesheet($staticUrl . '/static/default/styles/main.css');
    }

    /**
     * init page start
     */
    static public function onAdminPageStart() {
    	
        
        // get setting api
        $setting = Nuo::getApi('Setting');
        
        // allow member locations
        $view = Zend_Registry::get('Zend_View');
		
        // some thing else
        $view->headMeta()
	      ->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
	      ->appendHttpEquiv('Content-Language', $view->locale()->getLocale()->__toString());
        
        // define title
        $staticUrl = $view -> baseUrl();
        
        // add scripts
        $view -> headLink() -> prependStylesheet($staticUrl . '/static/scripts/jqueryui/css/ui-lightness/jquery-ui-1.8.21.custom.css');
        $view -> headScript() -> prependFile($staticUrl . '/static/scripts/jqueryui/js/jquery-ui-1.8.21.custom.min.js');
        $view -> headScript() -> prependFile($staticUrl . '/static/scripts/jquery/latest.js');

        $view -> headTitle($setting->getSetting('core.siteadmin.title'));

        $view -> headLink() -> prependStylesheet($staticUrl . '/static/admin/styles/main.css');
    }

}
